<%@ page import="com.beans.MemberInfo" %>
<%@ page import="com.dao.MemberDao" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="css/edittable.css" />
    <script type="text/javascript" src="js/jquery-1.8.0.js"></script>

    <style>
        label{
            display:block;
            margin-top:4px;
            color:red;
        }

        .td_input{
            width:230px;
        }

    </style>

</head>
<body>
<div class ="div_title">
    <div class="div_titlename"> <img src="${pageContext.request.contextPath }/images/san_jiao.gif" ><span>会员管理  会员信息</span></div>
</div>

<%
    int memberId=Integer.parseInt(request.getParameter("id"));
    MemberInfo member=new MemberDao().getMemeberById(memberId);
    request.setAttribute("member", member);
%>
<input type="hidden" name="goodsId" value="${member.id}">
<table class="edit_table" >
    <tr>
        <td class="td_info">会员账号</td>
        <td class="td_input">
            <label class="txtbox" >${member.memberNo} </label>
        </td>
        <td class="td_info">会员姓名</td>
        <td>
            <label class="txtbox" >${member.memberName} </label>
        </td>

    </tr>

    <tr>
        <td class="td_info">联系电话</td>
        <td>
            <label class="txtbox" >${member.phone} </label>
        </td>
        <td class="td_info">电子邮箱</td>
        <td><label class="txtbox" >${member.email} </label>

    </tr>

    <tr >
        <td class="td_info">注册日期</td>
        <td><label class="txtbox" >${member.registerDate} </label> </td>
        <td class="td_info">身份证号</td>
        <td>
            <label class="txtbox" >${member.phone} </label>
        </td>
    </tr>


    <tr >
        <td class="td_info">登录次数</td>
        <td><label class="txtbox" >${member.loginCounts} </label></td>
        <td class="td_info">最后登录时间</td>
        <td><label class="txtbox" >${member.lastLoginDate} </label> </td>
        <td></td>
    </tr>

    <tr >
        <td class="td_info">会员常用ip</td>
        <td id="td_ip"> </td>

        <td class="td_info">会员等级</td>
        <td><label class="txtbox" >${member.memberLevel} </label> </td>
    </tr>


    <tr>
        <td class="td_info"> </td>
        <td>
            <button class="form_btn" onclick="window.history.back()" >返回 </button>
        </td>
        <td></td>
        <td></td>
    </tr>
</table>

<script>
    //处理会员常用ip 的显示
    $(function(){
        var ipStr="${member.ip}";  // 是这样的格式 ===> 192.168.1.100,202.92.223.33,168.23.45.111
        if(ipStr!=""){
            var ipList=ipStr.split(",");
            $.each(ipList,function(){
                var labelStr="<label class='txtbox'>"+this+"</label>";
                $("#td_ip").append(labelStr);
            });
        }
    });
</script>
</body>
</html>
